package com.shuyixiao.javan8nv1.core;

import com.shuyixiao.javan8nv1.model.Workflow;

import java.util.HashMap;
import java.util.Map;

public class ExecutionContext {
    private final Workflow workflow;
    private final Map<String, NodeExecutionResult> nodeResults = new HashMap<>();

    public ExecutionContext(Workflow workflow) {
        this.workflow = workflow;
    }

    public Workflow getWorkflow() {
        return workflow;
    }

    public void addNodeResult(String nodeName, NodeExecutionResult result) {
        nodeResults.put(nodeName, result);
    }

    public NodeExecutionResult getNodeResult(String nodeName) {
        return nodeResults.get(nodeName);
    }

    public Map<String, NodeExecutionResult> getAllNodeResults() {
        return nodeResults;
    }
} 